#!/bin/bash

user=$USER
ip=${SSH_CLIENT%% *}
port=${SSH_CLIENT##* }
time=$(date '+%F %T')
hostname=$(hostname)

echo "$time,$user,$hostname,$ip,$port" > /etc/ssh/conn.log
